package com.vans.micro.order.controller;


import com.vans.api.api.order.OrderServiceAPI;
import com.vans.micro.order.service.impl.OrderInfoServiceImpl;
import order.OrderInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author QXY
 * @since 2020-10-24
 */
@RestController
public class OrderController implements OrderServiceAPI {

    @Autowired
    private OrderInfoServiceImpl orderService;

    @RequestMapping(value ="/index", method = RequestMethod.GET)
    @ResponseBody
    public String index(){

        return "炸弹王";
    }

    @Override
    public OrderInfoVO getByUserId(Integer userId) {
        System.out.println(userId);
        return orderService.getByUserId(userId);
    }
}
